package com.example.kingdee.controller;

import com.example.kingdee.common.AjaxResult;
import com.example.kingdee.dto.AllSunDto;
import com.example.kingdee.service.GameLandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 金蝶接口调用控制层
 */
@RestController
@RequestMapping("//gameLand")
public class GameLandController {

    @Autowired
    private GameLandService gameLandService;

    //齐套分析
    @PostMapping("/isComplete")
    public AjaxResult isComplete(@RequestBody AllSunDto allSunDto){
        String result = gameLandService.isComplete(allSunDto);
        if (result.equals("200")) {
            return AjaxResult.success("添加成功");
        }else {
            return AjaxResult.error(result);
        }
    }

    //节点汇报数据查询
    @PostMapping("/reportData")
    public AjaxResult reportData(@RequestBody AllSunDto allSunDto){
        String result = gameLandService.reportData(allSunDto);
        if (result.equals("200")) {
            return AjaxResult.success("添加成功");
        }else {
            return AjaxResult.error(result);
        }
    }
}
